<?php

/**
 * Created by PhpStorm.
 * User: wyr
 * Date: 14-10-8
 * Time: 下午10:14
 */
class Controller_Www1_Index extends FController
{

    function showMessage($message, $msgType, $url = null)
    {
        echo "<script>alert('{$message}');";
        if ($url) echo "location='{$url}';";
        echo "</script>";
    }





    public function testAction(){
        FCache::delete("province_list_20170601");
        $data = Service_User::getProvince();
        var_dump($data);exit();
    }

    /*
     * 获取城市信息
     */
    public function getCityAction(){
        $provinceCode = FRequest::getPostString("pro_code") ? FRequest::getPostString("pro_code") : "";
        if($provinceCode){
            $list = Service_User::getCity($provinceCode);
            if($list){
                $result = array('status' => 200, "data" => $list);
            }else{
                $result = array("status" => -1 , "error" => "城市数据未查询到");
            }
        }else{
            $result = array("status" => -2 , "error" => "省份id为空");
        }
        FResponse::output($result);
    }



    //广点通
    public function reportAction(){
        $this->display('report');
    }



}